﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.COM;

namespace MINERP.DAL.CommonDAL
{
    /// <summary>
    /// 委外商格子表数据操作类
    /// </summary>
    public class OutShopGridDAL : DALBase
    {
        public Tb_OutShopGrid GetEntityById(int gridId)
        {
            //return DataEntites.Tb_OutShopGrid.Where(p => p.GridId == gridId).FirstOrDefault();
            return null;
        }

        /// <summary>
        /// 返回所有委外的格子信息
        /// </summary>
        /// <param name="subAreaId"></param>
        /// <returns></returns>
        public List<Tb_OutShopGrid> GetAllGrids(int subAreaId)
        {
            GridSubArea subArea = DataEntites.GridSubArea.Where(a => a.Type == (int)SubAreaType.OutShop && a.SubAreaID == subAreaId).FirstOrDefault();
            if (subArea != null)
            {
                //subArea.Tb_OutShopGrid.Load();
                //return subArea.Tb_OutShopGrid.ToList();
                return null;
            }
            else
            {
                return null;
            }
        }

        /// <summary>
        /// 得到一个可用的且序号最小的格子
        /// </summary>
        /// <returns></returns>
        public Tb_OutShopGrid GetOneUsable()
        {
            //return DataEntites.Tb_OutShopGrid.Where(p => p.Status == (int)TB_OutShopGrid_Status.useAble).OrderByDescending(o => o.GridId).First();
            return null;
        }

    }
}
